﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Linq;

public interface ISocketProcess
{
    /// <summary>
    /// 连接成功
    /// </summary>
    void OnConnect();
    
    /// <summary>
    /// 请求发送后
    /// </summary>
    /// <param name="requestBase"></param>
    void OnRequestSend(RequestBase requestBase);

    /// <summary>
    /// 收到数据时
    /// </summary>
    /// <param name="client"></param>
    /// <param name="messagePacket"></param>
    /// <returns></returns>
    void OnReceive(MessagePacket messagePacket);

    /// <summary>
    /// 重登陆时
    /// </summary>
    void OnReConnect();

    /// <summary>
    /// 断线时
    /// </summary>
    void OnDisconnect();
}

public enum State
{
    Closed,
    Connecting,
    Established,
    TryReconnect,
}
